﻿<img src="/images/new4.png" class="OpenLayoutImage">
<div class="OpenLayoutAnim">
    <img src="/images/location_icon.png" class="locationImg"><span class="LocationText">正在定位</span>
</div>
<script src="~/Scripts/userInfoMgr.js?201509201148"></script>
<script>
    var waitTimes = 10;
    var waitIndex = 0;

    $(function () {
        $("#preHome").show();
        $("body").attr("style", "background: #FF571F;");
        waitIndex = 0;
        LocationWait();
    });

    function LocationWait() {
        var text = "正在定位 ";
        if (waitIndex < waitTimes) {
            var dotNum = waitIndex % 3;
            for (var i = 0; i < dotNum; i++) {
                text += ".";
            }
            $(".LocationText").text(text);
            var lat = AddressMgr.getWXLat();
            if (lat != null && lat != "" ) {
                locationPoint(function () {
                    window.location.href = '/Home/Index';
                });
            } else {
                waitIndex++;
                window.setTimeout("LocationWait()", 1000);
            }
        } else {
            venderDialog("获取用户地址失败，请检查是否开启提供位置信息功能。");
        }
    }
</script>
